package tw.com.guestbook.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;

public class Detial extends Composite {
	private Label contentText = null;
	private Label titleText = null;
	private Label nickNameText = null;

	public Detial() {

		FlexTable flexTable = new FlexTable();
		initWidget(flexTable);

		Label lblNewLabel_2 = new Label("暱稱");
		flexTable.setWidget(0, 0, lblNewLabel_2);

		nickNameText = new Label("New label");
		flexTable.setWidget(0, 1, nickNameText);

		Label lblNewLabel_3 = new Label("標題");
		flexTable.setWidget(1, 0, lblNewLabel_3);

		titleText = new Label("New label");
		flexTable.setWidget(1, 1, titleText);

		Label lblNewLabel_4 = new Label("留言內容");
		flexTable.setWidget(2, 0, lblNewLabel_4);

		contentText = new Label("New label");
		contentText.setDirectionEstimator(true);
		flexTable.setWidget(2, 1, contentText);
	}

	public void setValue(Post post) {
		this.contentText.setText(post.getContent());
		this.nickNameText.setText(post.getNickname());
		this.titleText.setText(post.getTitle());
	}

}
